home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1992-01-29  |  5.4 KB  |  175 lines  |  [TEXT/MPS ]

  1. ; Version: 1.4
  2. ; Created: Friday, October 20, 1989 at 9:11:52 PM
  3. ; File: Aliases.a
  4. ;
  5. ; Assembler Interface to the Macintosh Libraries
  6. ; Copyright Apple Computer, Inc. 1989-1991
  7. ; All Rights Reserved
  8. ;
  9. ;--------------------------------------------------------------------
  10.     IF &TYPE('__IncludingAliases__') = 'UNDEFINED' THEN
  11. __IncludingAliases__    SET    1
  12.  
  13. ;*********************************************************************
  14. ;***************            Constants        **************************
  15. ;*********************************************************************
  16.  
  17. rAliasType        EQU         'alis'                    ;Aliases are stored as resources of this type
  18.  
  19. ; define alias resolution action rules mask
  20. kARMmountVol      EQU         $00000001                 ; mount the volume automatically
  21. kARMnoUI          EQU         $00000002                 ; no user interface allowed during resolution
  22. kARMmultVols      EQU         $00000008                 ; search on multiple volumes
  23. kARMsearch        EQU         $00000100                 ; search quickly
  24. kARMsearchMore    EQU         $00000200                 ; search further
  25. kARMsearchRelFirst    EQU     $00000400                 ; search target on a relative path first
  26.  
  27. ; define alias record information types
  28. asiZoneName       EQU         -3                        ; get zone name
  29. asiServerName     EQU         -2                        ; get server name
  30. asiVolumeName     EQU         -1                        ; get volume name
  31. asiAliasName      EQU         0                         ; get aliased file/folder/volume name
  32. asiParentName     EQU         1                         ; get parent folder name
  33.  
  34.  
  35. ;*********************************************************************
  36. ;***************            Data Structures     **********************
  37. ;*********************************************************************
  38.  
  39.  
  40. ; define the alias record that will be the blackbox for the caller
  41. AliasRecord       RECORD      0
  42. ; following two fields for application use
  43. userType          DS.L        1                         ; appl stored type
  44. aliasSize         DS.W        1                         ; alias record size in bytes, for appl usage
  45. ; what follows is a variable length amount of data that is private
  46.                   ENDR
  47.  
  48. ;*********************************************************************
  49. ;***************            Public Interfaces    **********************
  50. ;*********************************************************************
  51.  
  52. ;{****                        High Level Routines             ****}
  53.  
  54. ; create a new alias between fromFile-toFile and return alias
  55. ;    record handle.
  56. ;pascal OSErr NewAlias (    const FSSpec *fromFile,    //I
  57. ;                                const FSSpec *target,//I
  58. ;                                AliasHandle *alias)         //O
  59. ;= {0x7002,0xA823};
  60.  
  61.                   MACRO
  62.                   _NewAlias
  63.                   MOVEQ       #2,D0
  64.                   DC.W        $A823
  65.                   ENDM
  66.  
  67. ; create a minimal new alias for a target and return alias
  68. ;   record handle 
  69. ;pascal OSErr NewAliasMinimal (const FSSpec *target,    /*I*/
  70. ;                                AliasHandle *alias)             /*O*/
  71. ;= {0x7008,0xA823};
  72.  
  73.                   MACRO
  74.                   _NewAliasMinimal
  75.                   MOVEQ       #8,D0
  76.                   DC.W        $A823
  77.                   ENDM
  78.  
  79. ; create a minimal new alias from a target fullpath (optional zone and server name)
  80. ;    and return alias record handle ;
  81. ;pascal OSErr NewAliasMinimalFromFullpath (short fullpathLength, /*I*/
  82. ;                                const unsigned char *fullpath,     /*I*/
  83. ;                                const Str32 zoneName,            /*I*/
  84. ;                                const Str31 serverName,            /*I*/
  85. ;                                AliasHandle *alias)             /*O*/
  86. ;= {0x7009,0xA823};
  87.  
  88.                   MACRO
  89.                   _NewAliasMinimalFromFullpath
  90.                   MOVEQ       #9,D0
  91.                   DC.W        $A823
  92.                   ENDM
  93.  
  94. ; given an alias handle and fromFile, resolve the alias, update the
  95. ;    alias record and return aliased filename and wasChanged flag.
  96. ;pascal OSErr ResolveAlias(const FSSpec *fromFile, //I
  97. ;                                AliasHandle alias,            //O
  98. ;                                FSSpec *target,    //O
  99. ;                                Boolean *wasChanged)        //O
  100. ;= {0x7003,0xA823};
  101.  
  102.                   MACRO
  103.                   _ResolveAlias
  104.                   MOVEQ       #3,D0
  105.                   DC.W        $A823
  106.                   ENDM
  107.  
  108. ; given an alias handle and an index specifying requested alias information
  109. ;    type, return the information from alias record as a string.
  110. ;pascal OSErr GetAliasInfo(     AliasHandle alias,            //I
  111. ;                                AliasInfoType index,        //I
  112. ;                                Str63 theString)            //O
  113. ;= {0x7007,0xA823};
  114.  
  115.                   MACRO
  116.                   _GetAliasInfo
  117.                   MOVEQ       #7,D0
  118.                   DC.W        $A823
  119.                   ENDM
  120.  
  121.  
  122. ; given a file spec, return target file spec if input file spec is an alias.
  123. ;    It resolves the entire alias chain or one step of the chain.  It returns
  124. ;    info about whether the target is a folder or file; and whether the input
  125. ;    file spec was an alias or not.
  126. ;pascal OSErr ResolveAliasFile(FSSpec    *theSpec,            /*I/O*/    
  127. ;                                Boolean    resolveAliasChains, /*I*/
  128. ;                                Boolean    *targetIsFolder,    /*O*/
  129. ;                                Boolean    *wasAliased)        /*O*/
  130. ;= {0x700C,0xA823};
  131.  
  132.                   MACRO
  133.                   _ResolveAliasFile
  134.                   MOVEQ       #$0C,D0
  135.                   DC.W        $A823
  136.                   ENDM
  137.  
  138.  
  139. ;{****                        Low Level Routines            ****}
  140.  
  141. ; given an alias handle and fromFile, match the alias and return
  142. ;    aliased filename(s) and needsUpdate flag.
  143. ;pascal OSErr MatchAlias(const FSSpec *fromFile, //I
  144. ;                                unsigned long rulesMask,    //I
  145. ;                                const AliasHandle alias,    //I
  146. ;                                short *aliasCount,            //I/O
  147. ;                                FSSpecList aliasList,         //O
  148. ;                                Boolean *needsUpdate,        //O
  149. ;                                AliasFilterProcPtr aliasFilter, //I 
  150. ;                                Ptr yourDataPtr)            //I 
  151. ;= {0x7005,0xA823};
  152.  
  153.                   MACRO
  154.                   _MatchAlias
  155.                   MOVEQ       #5,D0
  156.                   DC.W        $A823
  157.                   ENDM
  158.  
  159. ; given a fromFile-toFile pair and an alias handle, update the
  160. ;    alias record pointed to by alias handle to represent newToFile
  161. ;    as the new alias.
  162. ;pascal OSErr UpdateAlias (const FSSpec *fromFile, //I
  163. ;                                const FSSpec *target, //I
  164. ;                                AliasHandle alias,            //I/O
  165. ;                                Boolean *wasChanged)        //O
  166. ;= {0x7006,0xA823};
  167.  
  168.                   MACRO
  169.                   _UpdateAlias
  170.                   MOVEQ       #6,D0
  171.                   DC.W        $A823
  172.                   ENDM
  173.  
  174.  
  175.     ENDIF    ; ...already included